<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@include file="/taglibs.jsp" %>
<%@taglib uri="http://displaytag.sf.net/el" prefix="display" %>
<style type="text/css">
    @import url("${ctx}/resource/admin/displaytag/zdisplaytag.css");
    @import url("${ctx}/resource/admin/displaytag/alternative.css");
</style>
<html>
<body>
<display:table name="list"
               requestURI="list.html" class="list"
               id="row" cellspacing="0" cellpadding="0" pagesize="5">
    <display:column style="width:60px;" media="html" title="编号">
        <c:out value="${row_rowNum}"/>
    </display:column>
    <display:column title="专家姓名" property="expertName"/>
    <display:column title="古玩鉴赏证书">
        <img style="width:100px;" src="${ctx}/${row.picture1}"/>
    </display:column>
    <display:column title="古玩营业执照">
        <img style="width:100px;" src="${ctx}/${row.picture2}"/>
    </display:column>
    <display:column title="内容" property="content"/>
    <display:column title="状态" property="status"/>
    <display:column title="认证" style="width:40px;">
        <img src="${ctx}/resource/admin/images/pencil.png"
             onclick="return approveOne('${row.id}');" style="cursor:hand;"/>
    </display:column>
    <display:column title="删除" style="width:40px;">
        <img src="${ctx}/resource/admin/images/delete.png"
             onclick="return deleteOne('${row.id}');" style="cursor:hand;"/>
    </display:column>
    <c:if test="${1==1 }"></c:if>
</display:table>
</body>
<script type="text/javascript">
    function deleteOne(id) {
        if (!confirm("确定要删除吗?")) {
            return false;
        }
        var params = {id: id};
        $.post("editDelete.html", params, function (
            result) {
            result = eval("(" + result + ")");
            if (result.status == "true" || result.status == true) {
                alert('成功');
                window.location.href = "${ctx}/admin/expert/list.html";
            }
        });
    }

    function approveOne(id) {
        if (!confirm("确定认证通过吗?")) {
            return false;
        }
        var params = {id: id};
        $.post("approve.html", params, function (
            result) {
            result = eval("(" + result + ")");
            if (result.status == "true" || result.status == true) {
                alert('成功');
                window.location.href = "${ctx}/admin/expert/list.html";
            }
        });
    }
</script>
</html>
